<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  
  <title>博客的隐藏 | Leon&#39;s blog</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="前言 我在学习hexo博客框架时查到网上对于博客的隐藏大致分为种方案.     第一种方案  是主题自带的方案例如next自带    很可惜我使用的这个漂亮的miho并不支持隐藏博客操作">
<meta property="og:type" content="article">
<meta property="og:title" content="博客的隐藏">
<meta property="og:url" content="https://leonlee233.github.io/2020/05/04/%E5%8D%9A%E5%AE%A2%E7%9A%84%E9%9A%90%E8%97%8F/index.html">
<meta property="og:site_name" content="Leon&#39;s blog">
<meta property="og:description" content="前言 我在学习hexo博客框架时查到网上对于博客的隐藏大致分为种方案.     第一种方案  是主题自带的方案例如next自带    很可惜我使用的这个漂亮的miho并不支持隐藏博客操作">
<meta property="og:locale">
<meta property="og:image" content="https://s1.ax1x.com/2020/04/20/JQI7rt.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/04/20/JQITKI.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/YgzR39.md.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/Ygz4nx.md.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/Y2SC4g.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/YgzWcR.md.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/Ygzch4.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/Ygz29J.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/05/17/Ygzfj1.jpg">
<meta property="og:image" content="https://s1.ax1x.com/2020/04/20/JQopMn.jpg">
<meta property="article:published_time" content="2020-05-04T03:25:30.000Z">
<meta property="article:modified_time" content="2023-10-26T05:47:26.502Z">
<meta property="article:author" content="Leon Lee">
<meta property="article:tag" content="教程">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://s1.ax1x.com/2020/04/20/JQI7rt.jpg">
<meta name="twitter:creator" content="@https:&#x2F;&#x2F;twitter.com&#x2F;leonwithleo">
  
    <link rel="alternate" href="/atom.xml" title="Leon's blog" type="application/atom+xml">
  
  
    <link rel="shortcut icon" href="/favicon.png">
  
  
    
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/typeface-source-code-pro@0.0.71/index.min.css">

  
  
<link rel="stylesheet" href="/css/style.css">

  
    
<link rel="stylesheet" href="/fancybox/jquery.fancybox.min.css">

  
  
<meta name="generator" content="Hexo 6.3.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Leon&#39;s blog</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"><span class="fa fa-bars"></span></a>
        
          <a class="main-nav-link" href="/">主页</a>
        
          <a class="main-nav-link" href="/archives">归档</a>
        
      </nav>
      <nav id="sub-nav">
        
        
          <a class="nav-icon" href="/atom.xml" title="RSS Feed"><span class="fa fa-rss"></span></a>
        
        <a class="nav-icon nav-search-btn" title="Suche"><span class="fa fa-search"></span></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Suche"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://leonlee233.github.io"></form>
      </div>
    </div>
  </div>
</header>

      <div class="outer">
        <section id="main"><article id="post-博客的隐藏" class="h-entry article article-type-post" itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
  <div class="article-meta">
    <a href="/2020/05/04/%E5%8D%9A%E5%AE%A2%E7%9A%84%E9%9A%90%E8%97%8F/" class="article-date">
  <time class="dt-published" datetime="2020-05-04T03:25:30.000Z" itemprop="datePublished">2020-05-04</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="p-name article-title" itemprop="headline name">
      博客的隐藏
    </h1>
  

      </header>
    
    <div class="e-content article-entry" itemprop="articleBody">
      
        <h3 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h3><p> 我在学习hexo博客框架时查到网上对于博客的隐藏大致分为种方案.<br>     <a target="_blank" rel="noopener" href="https://blog.csdn.net/m0_37323771/article/details/80672271">第一种方案</a>  是主题自带的方案例如next自带  </p>
<p> <strong>很可惜我使用的这个漂亮的miho并不支持隐藏博客操作</strong></p>
<span id="more"></span>  
<p>今天的风儿有点喧嚣:<br>    <a target="_blank" rel="noopener" href="https://imgchr.com/i/JQI7rt"><img src="https://s1.ax1x.com/2020/04/20/JQI7rt.jpg" alt="JQI7rt.jpg"></a></p>
<p>But!!聪明的Leon找到了另一种非常方便并且可行的方式达到了隐藏博客的目的的方法   </p>
<p>  和老夫讲道理是没用的:<br>  <a target="_blank" rel="noopener" href="https://imgchr.com/i/JQITKI"><img src="https://s1.ax1x.com/2020/04/20/JQITKI.jpg" alt="JQITKI.jpg"></a></p>
<h3 id="第一步-安装hexo-generator-index2"><a href="#第一步-安装hexo-generator-index2" class="headerlink" title="第一步 安装hexo-generator-index2"></a>第一步 安装hexo-generator-index2</h3><p>使用cd命令进入自己的博客的所在目录:</p>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/YgzR39"><img src="https://s1.ax1x.com/2020/05/17/YgzR39.md.jpg" alt="YgzR39.md.jpg"></a></p>
<p>现在可以安装<br>    <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-generator-index2 --save</span><br><span class="line">$ npm uninstall hexo-generator-index --save</span><br></pre></td></tr></table></figure></p>
<p>也可以使用一步到位方法嘿嘿<br>    <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ npm install hexo-generator-index2 --save &amp;&amp; npm uninstall hexo-generator-index --save</span><br></pre></td></tr></table></figure></p>
<p>这时候他会跑一段代码,可能还会报错,但是别慌,实际上还是正常使用的嗷!!</p>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/Ygz4nx"><img src="https://s1.ax1x.com/2020/05/17/Ygz4nx.md.jpg" alt="Ygz4nx.md.jpg"></a></p>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/Y2SC4g"><img src="https://s1.ax1x.com/2020/05/17/Y2SC4g.jpg" alt="Y2SC4g.jpg"></a></p>
<p>实在不放心怂的话可以使用本地端口测试一下嗷</p>
<pre><code><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo s</span><br></pre></td></tr></table></figure>
  
</code></pre>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/YgzWcR"><img src="https://s1.ax1x.com/2020/05/17/YgzWcR.md.jpg" alt="YgzWcR.md.jpg"></a></p>
<p>可以看到使用是完全没有问题的</p>
<p><strong>hexo-generator-index2可以完全替代官方的hexo-generator-index，所以安装之后，先卸载官方的插件，不然会引起一些冲突</strong> (开发者的解释)</p>
<h3 id="第二步-配置"><a href="#第二步-配置" class="headerlink" title="第二步 配置!"></a>第二步 配置!</h3><p>修改hexo的配置文件<br>打开hexo博客根目录下的_config.yml<br>添加以下内容</p>
<pre><code><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"> <span class="comment"># index2 generator是否包含官方的hexo-generator-index，默认true（包含）</span></span><br><span class="line"> index2_include_index: <span class="literal">true</span> <span class="comment"># defult is true</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 配置index2 generator，可以是数组或对象</span></span><br><span class="line"> index2_generator:</span><br><span class="line"> per_page: 10</span><br><span class="line"> order_by: -<span class="built_in">date</span></span><br><span class="line"> include:</span><br><span class="line">    - category Web <span class="comment"># 只显示包含Web分类下的文章,可以删除</span></span><br><span class="line">exclude:</span><br><span class="line">    - tag Hide <span class="comment"># 不显示包含标签为Hexo的文章</span></span><br></pre></td></tr></table></figure>
</code></pre>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/Ygzch4"><img src="https://s1.ax1x.com/2020/05/17/Ygzch4.jpg" alt="Ygzch4.jpg"></a></p>
<p>此处作者注释给的很明白,也很容易使用的说   </p>
<h3 id="第三步-使用并添加标签"><a href="#第三步-使用并添加标签" class="headerlink" title="第三步 使用并添加标签"></a>第三步 使用并添加标签</h3><p>只需要在镖头的标签中添加Hide就可以在主页隐藏博文啦:</p>
<pre><code>    <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: leon影集02成都游记</span><br><span class="line"><span class="built_in">date</span>: 2020-04-20 19:53:25</span><br><span class="line">tags: [游记,摄影,Hide]</span><br><span class="line">---</span><br></pre></td></tr></table></figure>
</code></pre>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/Ygz29J"><img src="https://s1.ax1x.com/2020/05/17/Ygz29J.jpg" alt="Ygz29J.jpg"></a></p>
<p>效果如下:</p>
<p><a target="_blank" rel="noopener" href="https://imgchr.com/i/Ygzfj1"><img src="https://s1.ax1x.com/2020/05/17/Ygzfj1.jpg" alt="Ygzfj1.jpg"></a></p>
<p>想要找到隐藏的博客只需要去标签归档页面就可以找到啦</p>
<p><img src="https://s1.ax1x.com/2020/04/20/JQopMn.jpg" alt="JQopMn.jpg"></p>

      
    </div>
    <footer class="article-footer">
      <a data-url="https://leonlee233.github.io/2020/05/04/%E5%8D%9A%E5%AE%A2%E7%9A%84%E9%9A%90%E8%97%8F/" data-id="clo6uzd8l000j8cukdm2cec9h" data-title="博客的隐藏" class="article-share-link"><span class="fa fa-share">Teilen</span></a>
      
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%95%99%E7%A8%8B/" rel="tag">教程</a></li></ul>

    </footer>
  </div>
  
    
<nav id="article-nav">
  
    <a href="/2020/05/17/%E5%8D%9A%E5%AE%A2%E7%9A%84%E5%85%B3%E4%BA%8E%E9%A1%B5%E9%9D%A2/" id="article-nav-newer" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Neuer</strong>
      <div class="article-nav-title">
        
          博客的关于页面
        
      </div>
    </a>
  
  
    <a href="/2020/04/30/%E5%A4%A7%E5%AD%A6%E6%9D%82%E6%B8%B8/" id="article-nav-older" class="article-nav-link-wrap">
      <strong class="article-nav-caption">Älter</strong>
      <div class="article-nav-title">大学杂游</div>
    </a>
  
</nav>

  
</article>


</section>
        
          <aside id="sidebar">
  
    

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tags</h3>
    <div class="widget">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hide/" rel="tag">Hide</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Literature-Review/" rel="tag">Literature Review</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%9B%9E%E5%BF%86%E5%BD%95/" rel="tag">回忆录</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%A5%87%E6%80%AA%E7%9A%84%E7%A2%8E%E7%A2%8E%E5%BF%B5/" rel="tag">奇怪的碎碎念</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%AD%A6%E4%B9%A0%E5%BF%83%E5%BE%97/" rel="tag">学习心得</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" rel="tag">学习笔记</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%91%84%E5%BD%B1/" rel="tag">摄影</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%95%99%E7%A8%8B/" rel="tag">教程</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%B8%B8%E8%AE%B0/" rel="tag">游记</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%BE%8E%E5%9B%BE/" rel="tag">美图</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Tag Cloud</h3>
    <div class="widget tagcloud">
      <a href="/tags/Hide/" style="font-size: 20px;">Hide</a> <a href="/tags/Literature-Review/" style="font-size: 10px;">Literature Review</a> <a href="/tags/%E5%9B%9E%E5%BF%86%E5%BD%95/" style="font-size: 12px;">回忆录</a> <a href="/tags/%E5%A5%87%E6%80%AA%E7%9A%84%E7%A2%8E%E7%A2%8E%E5%BF%B5/" style="font-size: 10px;">奇怪的碎碎念</a> <a href="/tags/%E5%AD%A6%E4%B9%A0%E5%BF%83%E5%BE%97/" style="font-size: 18px;">学习心得</a> <a href="/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/" style="font-size: 10px;">学习笔记</a> <a href="/tags/%E6%91%84%E5%BD%B1/" style="font-size: 14px;">摄影</a> <a href="/tags/%E6%95%99%E7%A8%8B/" style="font-size: 16px;">教程</a> <a href="/tags/%E6%B8%B8%E8%AE%B0/" style="font-size: 12px;">游记</a> <a href="/tags/%E7%BE%8E%E5%9B%BE/" style="font-size: 10px;">美图</a>
    </div>
  </div>

  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archiv</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/10/">October 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2023/07/">July 2023</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/11/">November 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2021/06/">June 2021</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">June 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/05/">May 2020</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/04/">April 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">letzter Beitrag</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2023/10/26/DETR%E7%AC%94%E8%AE%B0/">文章总结：DETR笔记</a>
          </li>
        
          <li>
            <a href="/2023/07/14/%E4%B8%80%E4%B8%AA%E5%A5%BD%E7%9A%84%E5%BC%80%E5%A7%8B/">一个好的开始</a>
          </li>
        
          <li>
            <a href="/2021/11/20/linux%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%AE%89%E8%A3%85/">linux系统的安装</a>
          </li>
        
          <li>
            <a href="/2021/11/20/%E5%A4%A7%E6%95%B0%E6%8D%AE%E5%9F%BA%E7%A1%80step1-hadoop/">大数据基础step1:hadoop</a>
          </li>
        
          <li>
            <a href="/2021/06/05/Linux%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/">Linux学习笔记</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      
      &copy; 2023 Leon Lee<br>
      Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>

    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">主页</a>
  
    <a href="/archives" class="mobile-nav-link">归档</a>
  
</nav>
    


<script src="/js/jquery-3.6.4.min.js"></script>



  
<script src="/fancybox/jquery.fancybox.min.js"></script>




<script src="/js/script.js"></script>





  </div>
</body>
</html>